A “reference” is an object whose purpose is to act as a link between edge function parameters and nodes. By using references you can replace the static numbers entered as function parameters, by references to nodes. To use a particular reference in an edge function, simply open the “Edit edge” dialog box, and enter the name of the reference into the field containing the parameter you want to replace.

During a simulation DynRisk will insert the output values of these nodes as function parameters in the edges. Hence instead of having fixed numbers as function parameters, these parameters may become stochastic variables.

References are also useful if you need to use a specific parameter in many edge functions. Instead of just typing in the constant parameter value, you can use a reference to a deterministic independent node whose output value is equal to the parameter value. Later, if you need to run a simulation with a different parameter value, you only need to update the referenced node, and not all the edge functions.

Creating references

References are created by using the “Create reference…” command in the “Model” menu. To create a reference to a node, select this node, and choose the “Create reference…” command. This will bring up a dialog box where you are asked to enter a unique reference into a field. As a default, DynRisk suggests simply the name of the node as reference. In most cases this is perfectly OK. 

The point is that we need to choose a name for the reference which is unique among the references. Hence, if we had created another reference earlier with the same name, then we would need to come up with something else this time. 

To assist you in the process of finding a name for the reference, the dialog box also contains a list of all previously defined references.

If you try to enter a name that is already in use, DynRisk will display the following error message below the list of references:

“This reference name is already in use. Please choose a unique reference name!”

If you try to create a reference to node which already is linked to another reference, DynRisk will display the following error message below the list of references:

“This node is already linked to a reference. Multiple references are NOT allowed!”

As soon as you have managed to find a suitable name for the new reference, you create the reference object by clicking the “OK” button. Alternatively, you can cancel this operation by clicking the “Cancel” button.

If you selected only one node before bringing up the “Create reference” dialog box, clicking “OK” or “Cancel” will close the dialog box. If more than one node was selected, DynRisk will allow you to create references for all these before dismissing the dialog box.

If you want to break the sequence of reference creation before reaching the end, press the “Option” key on the keyboard while clicking either “OK” or “Cancel”.